/*
 * Created on 2004-12-29
 *
 * 
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.dcivision.dms.web;

import java.io.InputStream;
import java.sql.Connection;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.Hits;
import org.apache.lucene.search.Query;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;

import com.dcivision.dms.bean.DmsDocument;
import com.dcivision.dms.core.DocumentRetrievalManager;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.ErrorConstant;
import com.dcivision.framework.FullTextIndexFactory;
import com.dcivision.framework.GlobalConstant;
import com.dcivision.framework.SessionContainer;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.Utility;
import com.dcivision.framework.web.AbstractMaintAction;

/**
  MaintDmsFullTextViewerAction.java

  This class is the for Dms Full Text Viewer.

  @author      jerry zhou
  @company     DCIVision Limited
  @creation date   01/24/2005
  @version     $Revision: 1.3.2.1 $
*/
public class MaintDmsIndexViewerAction extends AbstractMaintAction {

  public static final String REVISION = "$Revision: 1.3.2.1 $";
  
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException {
    try{  	
  	  MaintDmsIndexViewerForm actionForm = (MaintDmsIndexViewerForm) form;
      this.documentIndexViewer(mapping,actionForm,request,response);
      return mapping.findForward(GlobalConstant.NAV_MODE_EDIT); 
    
    } catch (ApplicationException ex) {
      handleApplicationException(request, ex);
      return mapping.findForward(GlobalConstant.NAV_MODE_EDIT);
    }     
  }    
 
  public void documentIndexViewer(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ApplicationException {
  	MaintDmsIndexViewerForm actionForm = (MaintDmsIndexViewerForm) form;
    SessionContainer sessionContainer = this.getSessionContainer(request);
    Connection conn = this.getConnection(request); 
    
    InputStream fullTextFileInputStream = null;
    FormFile fullTextIndex = null;
    Query query1 = null;
    Query query2 = null;
    Query query3 = null;
    Query query4 = null;
    Query query5 = null;
    Query query6 = null;
    Query query7 = null;
    Query query8 = null;
    Query query9 = null;
    Query query10 = null;
    Query query11 = null;
    Query query12 = null;
    Query query13 = null;
    Query query14 = null;
    Query query15 = null;
    Query query16 = null;
    Query query17 = null;
    Query query18 = null;
    Query query19 = null;
    Query query20 = null;
    Query query21 = null;
    Query query22 = null;
    Query query23 = null;
    Query query24 = null;
    Query query25 = null;
    Query query26 = null;
    Query query27 = null;
    Query query28 = null;
    Query query29 = null;
    Query query30 = null;
    Query query31 = null;
    Query query32 = null;
    Query query33 = null;
    Query query34 = null;
    Query query35 = null;
    Query query36 = null;
    Query query37 = null;
    Query query38 = null;
    Query query39 = null;
    Query query40 = null;
    Query query41 = null;
    Query query42 = null;
    Query query43 = null;
    Query query44 = null;
    
    Hits hits1 = null;
    Hits hits2 = null;
    Hits hits3 = null;
    Hits hits4 = null;
    Hits hits5 = null;
    Hits hits6 = null;
    Hits hits7 = null;
    Hits hits8 = null;
    Hits hits9 = null;
    Hits hits10 = null;
    Hits hits11 = null;
    Hits hits12 = null;
    Hits hits13 = null;
    Hits hits14 = null;
    Hits hits15 = null;
    Hits hits16 = null;
    Hits hits17 = null;
    Hits hits18 = null;
    Hits hits19 = null;
    Hits hits20 = null;
    Hits hits21 = null;
    Hits hits22 = null;
    Hits hits23 = null;
    Hits hits24 = null;
    Hits hits25 = null;
    Hits hits26 = null;
    Hits hits27 = null;
    Hits hits28 = null;
    Hits hits29 = null;
    Hits hits30 = null;
    Hits hits31 = null;
    Hits hits32 = null;
    Hits hits33 = null;
    Hits hits34 = null;
    Hits hits35 = null;
    Hits hits36 = null;
    Hits hits37 = null;
    Hits hits38 = null;
    Hits hits39 = null;
    Hits hits40 = null;
    Hits hits41 = null;
    Hits hits42 = null;
    Hits hits43 = null;
    Hits hits44 = null;
    
    try{ 
    	
      String opMode = actionForm.getOpMode();    
      Integer documentID = TextUtility.parseIntegerObj(actionForm.getDocumentID());      
       
      DocumentRetrievalManager docRetrievalManager = new DocumentRetrievalManager(sessionContainer,conn); 
      DmsDocument dmsDocument = docRetrievalManager.getDocument(documentID);
      
      if(!Utility.isEmpty(dmsDocument)){
    
        Analyzer analyzer = new org.apache.lucene.analysis.WhitespaceAnalyzer();
        QueryParser qParser = new QueryParser("DOCUMENT_NAME", analyzer);
        query1 = qParser.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
      
        QueryParser qParser2 = new QueryParser("PARENT_ID", analyzer);
        query2 = qParser2.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
      
        QueryParser qParser3 = new QueryParser("ROOT_ID", analyzer);
        query3 = qParser3.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser4 = new QueryParser("PRIORITY", analyzer);
        query4 = qParser4.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser5 = new QueryParser("DOCUMENT_TYPE", analyzer);
        query5 = qParser5.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser6 = new QueryParser("VERSION_PARENT_ID", analyzer);
        query6 = qParser6.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser7 = new QueryParser("EFFECTIVE_START_DATE", analyzer);
        query7 = qParser7.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser8 = new QueryParser("EFFECTIVE_END_DATE", analyzer);
        query8 = qParser8.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser9 = new QueryParser("USER_DEF_1", analyzer);
        query9 = qParser9.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser10 = new QueryParser("USER_DEF_2", analyzer);
        query10 = qParser10.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser11 = new QueryParser("USER_DEF_3", analyzer);
        query11 = qParser11.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser12 = new QueryParser("USER_DEF_4", analyzer);
        query12 = qParser12.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser13 = new QueryParser("USER_DEF_5", analyzer);
        query13 = qParser13.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser14 = new QueryParser("USER_DEF_6", analyzer);
        query14 = qParser14.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser15 = new QueryParser("USER_DEF_7", analyzer);
        query15 = qParser15.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser16 = new QueryParser("USER_DEF_8", analyzer);
        query16 = qParser16.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser17 = new QueryParser("USER_DEF_9", analyzer);
        query17 = qParser17.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser18 = new QueryParser("USER_DEF_10", analyzer);
        query18 = qParser18.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser19 = new QueryParser("DESCRIPTION", analyzer);
        query19 = qParser19.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser20 = new QueryParser("REFERENCE_NO", analyzer);
        query20 = qParser20.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser21 = new QueryParser("VERSION_ID", analyzer);
        query21 = qParser21.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser22 = new QueryParser("VERSION_NUMBER", analyzer);
        query22 = qParser22.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser23 = new QueryParser("VERSION_LABEL", analyzer);
        query23 = qParser23.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser24 = new QueryParser("UDF_ID", analyzer);
        query24 = qParser24.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser25 = new QueryParser("UDF_1", analyzer);
        query25 = qParser25.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser26 = new QueryParser("UDF_2", analyzer);
        query26 = qParser26.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser27 = new QueryParser("UDF_3", analyzer);
        query27 = qParser27.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser28 = new QueryParser("UDF_4", analyzer);
        query28 = qParser28.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser29 = new QueryParser("UDF_5", analyzer);
        query29 = qParser29.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser30 = new QueryParser("UDF_6", analyzer);
        query30 = qParser30.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser31 = new QueryParser("UDF_7", analyzer);
        query31 = qParser31.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser32 = new QueryParser("UDF_8", analyzer);
        query32 = qParser32.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser33 = new QueryParser("UDF_9", analyzer);
        query33 = qParser33.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser34 = new QueryParser("UDF_10", analyzer);
        query34 = qParser34.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser35 = new QueryParser("DCI_UNIQUE_ID", analyzer);
        query35 = qParser35.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser36 = new QueryParser("DCI_ID", analyzer);
        query36 = qParser36.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser37 = new QueryParser("DCI_UPDATE_DATE", analyzer);
        query37 = qParser37.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser38 = new QueryParser("DCI_UPDATER", analyzer);
        query38 = qParser38.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser39 = new QueryParser("DCI_UPDATER_ID", analyzer);
        query39 = qParser39.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser40 = new QueryParser("DCI_CREATE_DATE", analyzer);
        query40 = qParser40.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser41 = new QueryParser("DCI_CREATOR", analyzer);
        query41 = qParser41.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser42 = new QueryParser("DCI_CREATOR_ID", analyzer);
        query42 = qParser42.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser43 = new QueryParser("DCI_RECORD_STATUS", analyzer);
        query43 = qParser43.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
        
        QueryParser qParser44 = new QueryParser("FULL_TEXT", analyzer);
        query44 = qParser44.parse("DCI_OBJ_TYPE:\"D\" && DCI_RECORD_STATUS:\""+(GlobalConstant.RECORD_STATUS_ACTIVE+GlobalConstant.RECORD_STATUS_ACTIVE).toLowerCase()+"\" && DCI_ID:\"" + documentID + "\"");
                
        hits1 = FullTextIndexFactory.getInstance().queryHits(query1, sessionContainer,null,null); 
        hits2 = FullTextIndexFactory.getInstance().queryHits(query2, sessionContainer,null,null);
        hits3 = FullTextIndexFactory.getInstance().queryHits(query3, sessionContainer,null,null); 
        hits4 = FullTextIndexFactory.getInstance().queryHits(query4, sessionContainer,null,null); 
        hits5 = FullTextIndexFactory.getInstance().queryHits(query5, sessionContainer,null,null); 
        hits6 = FullTextIndexFactory.getInstance().queryHits(query6, sessionContainer,null,null); 
        hits7 = FullTextIndexFactory.getInstance().queryHits(query7, sessionContainer,null,null); 
        hits8 = FullTextIndexFactory.getInstance().queryHits(query8, sessionContainer,null,null); 
        hits9 = FullTextIndexFactory.getInstance().queryHits(query9, sessionContainer,null,null);
        hits10 = FullTextIndexFactory.getInstance().queryHits(query10, sessionContainer,null,null);
        hits11 = FullTextIndexFactory.getInstance().queryHits(query11, sessionContainer,null,null);
        hits12 = FullTextIndexFactory.getInstance().queryHits(query12, sessionContainer,null,null);
        hits13 = FullTextIndexFactory.getInstance().queryHits(query13, sessionContainer,null,null);
        hits14 = FullTextIndexFactory.getInstance().queryHits(query14, sessionContainer,null,null);
        hits15 = FullTextIndexFactory.getInstance().queryHits(query15, sessionContainer,null,null);
        hits16 = FullTextIndexFactory.getInstance().queryHits(query16, sessionContainer,null,null);
        hits17 = FullTextIndexFactory.getInstance().queryHits(query17, sessionContainer,null,null);
        hits18 = FullTextIndexFactory.getInstance().queryHits(query18, sessionContainer,null,null);
        hits19 = FullTextIndexFactory.getInstance().queryHits(query19, sessionContainer,null,null);
        hits20 = FullTextIndexFactory.getInstance().queryHits(query20, sessionContainer,null,null);
        hits21 = FullTextIndexFactory.getInstance().queryHits(query21, sessionContainer,null,null);
        hits22 = FullTextIndexFactory.getInstance().queryHits(query22, sessionContainer,null,null);
        hits23 = FullTextIndexFactory.getInstance().queryHits(query23, sessionContainer,null,null);
        hits24 = FullTextIndexFactory.getInstance().queryHits(query24, sessionContainer,null,null);
        hits25 = FullTextIndexFactory.getInstance().queryHits(query25, sessionContainer,null,null);
        hits26 = FullTextIndexFactory.getInstance().queryHits(query26, sessionContainer,null,null);
        hits27 = FullTextIndexFactory.getInstance().queryHits(query27, sessionContainer,null,null);
        hits28 = FullTextIndexFactory.getInstance().queryHits(query28, sessionContainer,null,null);
        hits29 = FullTextIndexFactory.getInstance().queryHits(query29, sessionContainer,null,null);
        hits30 = FullTextIndexFactory.getInstance().queryHits(query30, sessionContainer,null,null);
        hits31 = FullTextIndexFactory.getInstance().queryHits(query31, sessionContainer,null,null);
        hits32 = FullTextIndexFactory.getInstance().queryHits(query32, sessionContainer,null,null);
        hits33 = FullTextIndexFactory.getInstance().queryHits(query33, sessionContainer,null,null);
        hits34 = FullTextIndexFactory.getInstance().queryHits(query34, sessionContainer,null,null);
        hits35 = FullTextIndexFactory.getInstance().queryHits(query35, sessionContainer,null,null);
        hits36 = FullTextIndexFactory.getInstance().queryHits(query36, sessionContainer,null,null);
        hits37 = FullTextIndexFactory.getInstance().queryHits(query37, sessionContainer,null,null);
        hits38 = FullTextIndexFactory.getInstance().queryHits(query38, sessionContainer,null,null);
        hits39 = FullTextIndexFactory.getInstance().queryHits(query39, sessionContainer,null,null);
        hits40 = FullTextIndexFactory.getInstance().queryHits(query40, sessionContainer,null,null);
        hits41 = FullTextIndexFactory.getInstance().queryHits(query41, sessionContainer,null,null);
        hits42 = FullTextIndexFactory.getInstance().queryHits(query42, sessionContainer,null,null);
        hits43 = FullTextIndexFactory.getInstance().queryHits(query43, sessionContainer,null,null);
        hits44 = FullTextIndexFactory.getInstance().queryHits(query44, sessionContainer,null,null);
        
              
        Document doc = hits1.doc(0);
        String documentName = TextUtility.noNull(doc.get("DOCUMENT_NAME"));
      
        Document doc2 = hits2.doc(0);
        String parentID = TextUtility.noNull(doc.get("PARENT_ID"));
        
        Document doc3 = hits3.doc(0);
        String rootID = TextUtility.noNull(doc.get("ROOT_ID"));
        
        Document doc4 = hits4.doc(0);
        String priority = TextUtility.noNull(doc.get("PRIORITY"));
        
        Document doc5 = hits5.doc(0);
        String documentType = TextUtility.noNull(doc.get("DOCUMENT_TYPE"));
        
        Document doc6 = hits6.doc(0);
        String versionParentID = TextUtility.noNull(doc.get("VERSION_PARENT_ID"));
        
        Document doc7 = hits7.doc(0);
        String effectiveStartDate = TextUtility.noNull(doc.get("EFFECTIVE_START_DATE"));
        
        Document doc8 = hits8.doc(0);
        String effectiveEndDate = TextUtility.noNull(doc.get("EFFECTIVE_END_DATE"));
        
        Document doc9 = hits9.doc(0);
        String userDef1 = TextUtility.noNull(doc.get("USER_DEF_1"));
        
        Document doc10 = hits10.doc(0);
        String userDef2 = TextUtility.noNull(doc.get("USER_DEF_2"));
        
        Document doc11 = hits11.doc(0);
        String userDef3 = TextUtility.noNull(doc.get("USER_DEF_3"));
        
        Document doc12 = hits12.doc(0);
        String userDef4 = TextUtility.noNull(doc.get("USER_DEF_4"));
        
        Document doc13 = hits13.doc(0);
        String userDef5 = TextUtility.noNull(doc.get("USER_DEF_5"));
        
        Document doc14 = hits14.doc(0);
        String userDef6 = TextUtility.noNull(doc.get("USER_DEF_6"));
        
        Document doc15 = hits15.doc(0);
        String userDef7 = TextUtility.noNull(doc.get("USER_DEF_7"));
        
        Document doc16 = hits16.doc(0);
        String userDef8 = TextUtility.noNull(doc.get("USER_DEF_8"));
        
        Document doc17 = hits17.doc(0);
        String userDef9 = TextUtility.noNull(doc.get("USER_DEF_9"));
        
        Document doc18 = hits18.doc(0);
        String userDef10 = TextUtility.noNull(doc.get("USER_DEF_10"));
        
        Document doc19 = hits19.doc(0);
        String description = TextUtility.noNull(doc.get("DESCRIPTION"));
        
        Document doc20 = hits20.doc(0);
        String referenceNo = TextUtility.noNull(doc.get("REFERENCE_NO"));
        
        Document doc21 = hits21.doc(0);
        String versionID = TextUtility.noNull(doc.get("VERSION_ID"));
        
        Document doc22 = hits22.doc(0);
        String versionNumber = TextUtility.noNull(doc.get("VERSION_NUMBER"));
        
        Document doc23 = hits23.doc(0);
        String versionLabel = TextUtility.noNull(doc.get("VERSION_LABEL"));
        
        Document doc24 = hits24.doc(0);
        String udfID = TextUtility.noNull(doc.get("UDF_ID"));
        
        Document doc25 = hits25.doc(0);
        String udf_1 = TextUtility.noNull(doc.get("UDF_1"));
        
        Document doc26 = hits26.doc(0);
        String udf_2 = TextUtility.noNull(doc.get("UDF_2"));
        
        Document doc27 = hits27.doc(0);
        String udf_3 = TextUtility.noNull(doc.get("UDF_3"));
        
        Document doc28 = hits28.doc(0);
        String udf_4 = TextUtility.noNull(doc.get("UDF_4"));
        
        Document doc29 = hits29.doc(0);
        String udf_5 = TextUtility.noNull(doc.get("UDF_5"));
        
        Document doc30 = hits30.doc(0);
        String udf_6 = TextUtility.noNull(doc.get("UDF_6"));
        
        Document doc31 = hits31.doc(0);
        String udf_7 = TextUtility.noNull(doc.get("UDF_7"));
        
        Document doc32 = hits32.doc(0);
        String udf_8 = TextUtility.noNull(doc.get("UDF_8"));
        
        Document doc33 = hits33.doc(0);
        String udf_9 = TextUtility.noNull(doc.get("UDF_9"));
        
        Document doc34 = hits34.doc(0);
        String udf_10 = TextUtility.noNull(doc.get("UDF_10"));
        
        Document doc35 = hits35.doc(0);
        String dciUniqueID = TextUtility.noNull(doc.get("DCI_UNIQUE_ID"));
        
        Document doc36 = hits36.doc(0);
        String ID = TextUtility.noNull(doc.get("DCI_ID"));
        
        Document doc37 = hits37.doc(0);
        String updateDate = TextUtility.noNull(doc.get("DCI_UPDATE_DATE"));
        
        Document doc38 = hits38.doc(0);
        String updater = TextUtility.noNull(doc.get("DCI_UPDATER"));
        
        Document doc39 = hits39.doc(0);
        String updaterID = TextUtility.noNull(doc.get("DCI_UPDATER_ID"));
        
        Document doc40 = hits40.doc(0);
        String createDate = TextUtility.noNull(doc.get("DCI_CREATE_DATE"));
        
        Document doc41 = hits41.doc(0);
        String creator = TextUtility.noNull(doc.get("DCI_CREATOR"));
        
        Document doc42 = hits42.doc(0);
        String creatorID = TextUtility.noNull(doc.get("DCI_CREATOR_ID"));
        
        Document doc43 = hits43.doc(0);
        String recordStatus = TextUtility.noNull(doc.get("DCI_RECORD_STATUS"));
        
        Document doc44 = hits44.doc(0);
        String content = TextUtility.noNull(doc.get("FULL_TEXT"));
        
        if(!Utility.isEmpty(opMode) && GlobalConstant.OP_MODE_LIST_RETAIN.equals(opMode)){
      	  //actionForm.setContent(content+content2);
         actionForm.setDocumentName(documentName); 
         actionForm.setParentID(parentID);
         actionForm.setRootID(rootID);
         actionForm.setPriority(priority);
         actionForm.setDocumentType(documentType);
         actionForm.setVersionParentID(versionParentID);
         actionForm.setEffectiveStartDate(effectiveStartDate);
         actionForm.setEffectiveEndDate(effectiveEndDate);
         actionForm.setUserDef1(userDef1);
         actionForm.setUserDef2(userDef2);
         actionForm.setUserDef3(userDef3);
         actionForm.setUserDef4(userDef4);
         actionForm.setUserDef5(userDef5);
         actionForm.setUserDef6(userDef6);
         actionForm.setUserDef7(userDef7);
         actionForm.setUserDef8(userDef8);
         actionForm.setUserDef9(userDef9);
         actionForm.setUserDef10(userDef10);
         actionForm.setDescription(description);
         actionForm.setReferenceNo(referenceNo);
         actionForm.setVersionID(versionID);
         actionForm.setVersionNumber(versionNumber);
         actionForm.setVersionLabel(versionLabel);
         actionForm.setUdfID(udfID);
         actionForm.setDciUniqueID(dciUniqueID);
         actionForm.setID(ID);
         actionForm.setUpdateDate(updateDate);
         actionForm.setUpdater(updater);
         actionForm.setUpdaterID(updaterID);
         
         actionForm.setCreateDate(createDate);
         actionForm.setCreator(creator);
         actionForm.setCreatorID(creatorID);
         actionForm.setRecordStatus(recordStatus);
         
         actionForm.setContent(content);
        }
      }else{
      	throw new ApplicationException(ErrorConstant.DMS_MESSAGE_DOCUMENTID_IS_NOT_EXIST);
      }
      
             
    } catch (Exception ioe) {
      throw new ApplicationException(ErrorConstant.DMS_MESSAGE_DOCUMENTID_IS_NOT_EXIST);
    }   
  }
	
  public String getFunctionCode() {
   return null;
  }

  public String getMajorDAOClassName() {
    return null;
  }

}

